
import { Editor } from '@valuation/core';
import { CHILDREN, CommonAttr, GCXM, nodes, TREE, DW, FontColor } from './index';
import { xmlContent } from './data';

export async function getEditor() {
  const editor = new Editor({
    content: xmlContent,
    extensions: [
      GCXM,
      DW,
      TREE,
      CHILDREN,
      CommonAttr,
      FontColor,
      ...nodes
    ],
    onBeforeCreate() {
      console.log('beforeCreate');
    },
    enableContentCheck: true,
  });
  return await editor.initialize();
}

